<me:UIMENU x:Class="WPFExcelReport.TMU02"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"      
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
                    xmlns:me="clr-namespace:WPFExcelReport" 
                     xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    xmlns:HR="clr-namespace:WPFExcelReport;assembly=TICC_HRSTAMM" 
                    xmlns:FN="clr-namespace:WPFExcelReport;assembly=TICC_FUNCTIONS" 
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIMENU.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:TIMES100  x:Key="X100"/>
        <ucd:TIMES10  x:Key="X10"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:PreisConverter  x:Key="PreisConverter"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:TextTrimmingConverter  x:Key="Trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIMENU.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0">
            <WrapPanel>
                <Grid Margin="10,0,0,0" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button   Click="QueryCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button   Click="NewCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button  Click="EditCommand" Width="24" Height="20">
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Edit.png" />
                        </Button.Background>
                    </Button>
                </Grid>

                <Button    Click="CopyCommand" Height="20" Margin="15,0,0,0" Width="Auto" Content="{Binding Source={Localization:Translate Word=新建菜单}}" />
                <Button    Click="Copy1AllUsersCommand" Visibility="Collapsed" Height="20" Margin="5,0,0,0" Width="Auto" Content="{Binding Source={Localization:Translate Word=单功能复制到所有用户}}" />


                <Grid Margin="10,0,0,0" Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button   Click="SaveCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Save.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Button  Margin="10,0,0,0"  Content="{Binding Source={Localization:Translate Word=重置流水号}}" Click="ResetSeq"/>
            </WrapPanel>
            <WrapPanel>
                <TextBlock Text="{Binding ROWNID,Source={StaticResource ResourceKey=vwMaster}}"></TextBlock>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=用户:}}"></TextBlock>
                    <HR:TSHR Name="cHR" 
                             KEY="{Binding USERID,ElementName=TV}"
                             />
                </Grid>
                <TextBlock Text="{Binding Source={Localization:Translate Word=按功能过滤}}">
                </TextBlock>
                <FN:TSFUC Grid.Column="1" KEY="{Binding FUNC,ElementName=TV}"/>
                <TextBlock Text="{Binding Source={Localization:Translate Word=处理}}"></TextBlock>
                <ComboBox Text="{Binding PROCESS,Source={ StaticResource ResourceKey=vwMaster}}" 
                          Background="Gray"  MinWidth="100"  
                          IsEditable="True"
                          >
                    <ComboBoxItem>MENU</ComboBoxItem>
                    <ComboBoxItem>HIDDEN</ComboBoxItem>
                </ComboBox>
                <WrapPanel>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=位置}}"></TextBlock>
                    <FN:TSFGRP Grid.Column="1" KEY="{Binding FNCGP,ElementName=TV}"/>
                </WrapPanel>

                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=功能:}}"></TextBlock>
                    <FN:TSFUC Grid.Column="1" dwFN="{Binding dwFN,ElementName=TV}"/>
                </Grid>
            </WrapPanel>
            <WrapPanel>
                <Button   Content="{Binding Source={Localization:Translate Word=复制新用户}}" Margin="15,0,0,0"  Click="Copy2UserCommand"/>
                <WrapPanel Visibility="{Binding IsNew,ElementName=TV,Converter={StaticResource bv}}">
                    <TextBlock Text="{Binding ART,ElementName=TV}" Width="100"/>
                    <HR:TSHR  KEY="{Binding ART,ElementName=TV}"
                             
                              /> 
                    <Button Click="Copy2UserCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/button_ok.png" />
                        </Button.Background>
                    </Button>

                </WrapPanel>
            </WrapPanel>
        </StackPanel>
        <DataGrid  Grid.Row="1"  Grid.Column="0"
                   VerticalAlignment="Top"  
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"     
                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}"  
                    IsSynchronizedWithCurrentItem="True"  
                   RowDetailsVisibilityMode="Visible"
                   Name="dlgMaster"
                    Margin="0,0.2,0.2,0"
                    >
            <DataGrid.Columns>
                <DataGridTextColumn   Binding="{Binding Path=ROWNID}"  Header="{Binding Source={Localization:Translate Word=ID}}"   Width="Auto" />
                <DataGridTextColumn   Binding="{Binding Path=COMPANY}" Header="{Binding Source={Localization:Translate Word=公司}}"  Width="Auto" />
                <DataGridTextColumn  Binding="{Binding Path=USERID}" Header="{Binding Source={Localization:Translate Word=用户}}"  Width="Auto" />
                <DataGridTextColumn  Binding="{Binding Path=TAG}" Header="{Binding Source={Localization:Translate Word=菜单项}}"  Width="Auto" />
                <DataGridTextColumn   Binding="{Binding Path=FATHER}" Header="{Binding Source={Localization:Translate Word=主菜单}}" Width="Auto" />
                <DataGridTextColumn  Binding="{Binding Path=HEADER, Converter={StaticResource ResourceKey=gb2312}}"  Header="{Binding Source={Localization:Translate Word=功能}}"
                                    Width="Auto" />
            </DataGrid.Columns>
        </DataGrid  >
        <me:TUMENU
            Grid.Row="1" Grid.Column="1"
            EXAUF="{Binding USERID,ElementName=TV}"/>
    </Grid>
</me:UIMENU> 
 
